<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<div id="log"></div>
<script>
test(() => assert_selection(
    '<div contenteditable>|</div>',
    selection => {
        selection.document.execCommand('insertText', false, '\u0E2D');
        selection.document.execCommand('insertText', false, '\u0E22');
        selection.document.execCommand('insertText', false, '\u0E32');
        selection.document.execCommand('insertText', false, '\u0E01');
        selection.document.execCommand('insertText', false, '\u0E0D');
        selection.document.execCommand('insertText', false, '\u0E35');
        selection.document.execCommand('insertText', false, '\u0E48');
        selection.document.execCommand('insertText', false, '\u0E1B');
        selection.document.execCommand('insertText', false, '\u0E38');
        selection.document.execCommand('insertText', false, '\u0E48');
        selection.document.execCommand('insertText', false, '\u0E19');
        selection.modify('move', 'backward', 'character');
        selection.modify('move', 'backward', 'character');
        selection.modify('move', 'backward', 'character');
        selection.document.execCommand('insertText', false, '\u0E44');
        selection.document.execCommand('insertText', false, '\u0E1B');
    },
    '<div contenteditable>\u0E2D\u0E22\u0E32\u0E01\u0E44\u0E1B|\u0E0D\u0E35\u0E48\u0E1B\u0E38\u0E48\u0E19</div>'),
    'insert a Thai character after a Thai "prepend" character');
</script>
